package day1;

public class Duration {
    private int hours;
    private int minutes;
    private int seconds;

    public Duration(int hours, int minutes, int seconds) {
        this.hours = hours;
        this.minutes = minutes;
        this.seconds = seconds;
    }

    public Duration(int seconds) {
        int hours = seconds / 3600;
        int minutes = (seconds-hours*60) % 60;
        this.hours = hours;
        this.minutes = minutes;
        this.seconds = seconds % 60;
    }

    public int getTotalSeconds() {
        int totalSeconds = this.hours*3600 + this.minutes*60 + this.seconds;
        return totalSeconds;
    }

    @Override
    public String toString() {
        return hours + ":" + minutes + ":" + seconds;
    }

    public int getHours() {
        return hours;
    }

    public void setHours(int hours) {
        this.hours = hours;
    }

    public int getMinutes() {
        return minutes;
    }

    public void setMinutes(int minutes) {
        this.minutes = minutes;
    }

    public int getSeconds() {
        return seconds;
    }

    public void setSeconds(int seconds) {
        this.seconds = seconds;
    }
}
